<html></html>
<head>
	<title>Test</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
   <!-- <link rel="stylesheet" href="../lib/css/layout.css"/>

    <script src="../lib/jquery-1.4.4.min.js" type="text/javascript"></script>

	<script src="../lib/jquery.js" type="text/javascript"></script>

	<script src="../lib/jquery.cookie.js" type="text/javascript"></script>

	<script src="../lib/jquery.treeview.js" type="text/javascript"></script>

	<script type="text/javascript" src="../lib/demo.js"></script></head>
-->
<body>

</head>
<body>
<?php
/**
 * @author HIENDV
 * @copyright 2012
 */
include_once 'Model/Menu.php';
$user = $_SESSION['username'];
$level=$_SESSION['level'];
//echo $level;
//$level=2;
//$user= "hiendv2210";
$acc = new Menu($user,$level);
$rs= $acc->load_Menu(0,1);
$result = '';
$j=0;
for($i=0;$i<count($rs);$i++){
    if($rs[$i][3]=='1'&& $j==0){
        $result= $result.'<li><span>'.$rs[$i][1].'</span><ul>';
        $j=1;
    }
    else if($rs[$i][3]=='1'&& $j==1){
        $result= $result.'</ul></li><li><span>'.$rs[$i][1].'</span><ul>';
        $j=1;
    }
    else if($rs[$i][3]!='1'&& $j==1){
        $result=$result.'<li ><a onclick="checkValue(\''.$rs[$i][5].'\')"><span>'.$rs[$i][1].'</span></a></li>';
    }
}
$result=$result.'</ul></li></ul>';
echo($result);
?>
</body>
</html>
